package org.xm.model;

import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;

import org.xm.utlis.DateUtils;
import org.xm.utlis.DateUtils.*;

@Data
public class Order {
    private Long id;
    private Date date;
    private int quantity;
    private BigDecimal plannedUnitPrice;
    private Long warehouseId;
    private String warehouseName;
    private Long itemId;
    private String itemName;

    // 按格式返回创建时间
    public String getDate() {
        if (this.date == null) {
            return DateUtils.dateFormat(new Date(System.currentTimeMillis()));
        }
        return DateUtils.dateFormat(this.date);
    }
}
